<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCWeb.Models.ViewData.DocumentNewViewData>" %>

<%@ Register Src="~/Views/Menu/MainMenu.ascx" TagName="MainMenu" TagPrefix="mmuc" %>

<%@ Register Src="~/Views/Shared/LogOnUserControl.ascx" TagName="LogOnUserControl" TagPrefix="louc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Create document</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">
        $(document).ready(function() {
            $("#DocumentForm").validate({
                rules: {
                    Name: {
                        required: true
                    },
                    FullPath: {
                        required: true
                    }

                },
                messages: {
                    Name: {
                        required: "Name cannot be blank"
                    },
                    FullPath: {
                        required: "File cannot be blank"
                    }
                }
            });
        });
    </script>
<louc:LogOnUserControl ID="LogOnUserControl1" runat="server" />
    <!-- BEGIN: MainMenu -->
    <mmuc:MainMenu ID="MainMenu1" runat="server" />
    <!-- END: MainMenu -->
    <br />
    <br />
    <%= Html.ValidationSummary()%>
    <% using (Html.BeginForm("Create", "Doc", FormMethod.Post, new { id = "DocumentForm", enctype = "multipart/form-data" }))
       {%>
<%--    <fieldset>
        <legend>Create document</legend>
        <p>
            <label for="Name">
                Name:</label>
            <%= Html.TextBox("Name", "")%>
            <%= Html.ValidationMessage("Name", "*")%>
        </p>
        <p>
            <label for="Desc">
                Description:</label>
            <%= Html.TextArea("Desc")%>
            <%= Html.ValidationMessage("Desc", "*")%>
        </p>
        <p>
            <label for="FullPath">
                File:</label>
            <input type="file" name="FullPath" id="FullPath" size="34"/>
            <%= Html.ValidationMessage("FullPath", "*")%>
        </p>
        <p>
            <label for="DocCategoryId">
                Category:</label>
            <%= Html.DropDownList("DocCategoryId", new SelectList(ViewData.Model.Categories, "DocCategoryId", "Category"))%>
            </p>
        <p>
            <label for="NewCategoryName">
                Or create new:</label>
            <%= Html.TextBox("NewCategoryName", "")%>
            <%= Html.ValidationMessage("NewCategoryName", "*")%>
        </p>
        <p>
            <label for="CommunityId">
                Community:</label>
            <%= Html.DropDownList("CommunityId", new SelectList(ViewData.Model.Communities, "CommunityId", "Name"))%>
            <%= Html.ValidationMessage("CommunityId", "*")%>
        </p>
        <br />
        <p>
            <input type="submit" value="Save" />
            <input type="reset" value="Reset" />
        </p>
    </fieldset>--%>
    <% } %>
    <div>
        <%=Html.ActionLink("Go back", "List", "Community") %>
    </div>
</asp:Content>
